package com.duwei.exception;


import com.alibaba.excel.exception.ExcelDataConvertException;
import com.duwei.util.ResponseResult;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

@ControllerAdvice
@ResponseBody
public class ControllerExceptionAdvice {

    @ExceptionHandler(value = ExcelDataConvertException.class)
    public ResponseResult handlerExcelDataConvertException(ExcelDataConvertException e){
        return new ResponseResult<Object>(503,"数据解析异常在第"+e.getRowIndex()+"行",null);
    }

}
